def query_bitable_records_with_requests():
    """
    使用requests库查询飞书多维表格记录的函数
    """
    # 以下假设这些是从飞书开发者后台获取到的相关认证信息等，实际使用中需替换为真实有效的值
    APP_ID = "cli_a7bc1b23853b9013"
    APP_SECRET = "ChsiFTzVeNJQVgOXkKdwrcNoIFw3BKYT"
    APP_TOKEN = "AGULbGJdIaCWyUsC1PKcYLnsn8b"
    TABLE_ID = "tblRYj7NzwxwwyfJ"
    VIEW_ID = "vewqxKxWDu"

    # 获取访问令牌
    access_token_url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
    access_token_headers = {
        "Content-Type": "application/json"
    }
    access_token_data = {
        "app_id": APP_ID,
        "app_secret": APP_SECRET
    }
    access_token_response = requests.post(access_token_url, headers=access_token_headers,
                                          data=json.dumps(access_token_data))
    if access_token_response.status_code != 200:
        print(f"获取访问令牌失败，状态码: {access_token_response.status_code}，错误信息: {access_token_response.text}")
        return None
    access_token = json.loads(access_token_response.text)["tenant_access_token"]

    # 构造请求数据
    request_data = {
        "view_id": VIEW_ID,
        "field_names": ["热量(kcal)", "脂肪(g)", "蛋白质（g）", "碳水化合物（g）"],
        "filter": {
            "conjunction": "and",
            "conditions": [
                {
                    "field_name": "年",
                    "operator": "is",
                    "value": ["2024"]
                },
                {
                    "field_name": "月",
                    "operator": "is",
                    "value": ["11月"]
                },
                {
                    "field_name": "日",
                    "operator": "is",
                    "value": ["18"]
                }
            ]
        },
        "automatic_fields": False
    }

    # 构造请求URL和请求头
    request_url = f"https://open.feishu.cn/open-apis/bitable/v1/apps/{APP_TOKEN}/tables/{TABLE_ID}/records/search"
    request_headers = {
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json"
    }

    # 发起请求
    response = requests.post(request_url, headers=request_headers, data=json.dumps(request_data))

    # 处理失败返回
    if response.status_code != 200:
        print(f"查询飞书多维表格记录失败，状态码: {response.status_code}，错误信息: {response.text}")
        return None

    # 处理业务结果
    response_data = json.loads(response.text)
    records = (response_data['data']['items'])
    return records
